﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
using JohnnySins.Entities;

namespace JohnnySins.DAL.Repositories
{
    public class MemberCancelStatsRepository : BaseRepository<MemberCancelStats>
    {
        protected override string TableName
        {
            get { return "[MemberCancelStatsRepository]"; }
        }


        public MemberCancelStats Find(string email)
        {
            return Connection.Query<MemberCancelStats>(
                @"  SELECT m.mcs_or_idx, m.mcs_canceldate, m.mcs_signupdate, m.mcs_cocode, m.mcs_picode, m.mcs_reseller, m.mcs_reason, 
                           m.mcs_memberstype, m.mcs_username, m.mcs_email, m.mcs_passwordremovaldate
                    FROM [MemberCancelStats] (nolock) m
                    WHERE m.mcs_email = @email", new { email = email }).SingleOrDefault();
        }

        
    }
}
